import threading
import queue


def worker(q):
    while True:
        item = q.get()
        print(f'working on {item}')
        print(f'Finished {item}')
        q.task_done()



q = queue.Queue()
threading.Thread(target=worker, args=(q,), daemon=True).start()

for item in range(10):
    q.put(item)
q.join()
print('Done')
